package com.isoft.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 特殊操作消息表-存储航班号变更等特殊事件
 * @TableName SPECIAL_MESSAGES
 */
@TableName(value ="SPECIAL_MESSAGES")
@Data
public class SpecialMessages implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long SPEC_ID;

    /**
     *
     */
    private Long META_ID;

    /**
     *
     */
    private Long FLIGHT_ID;

    /**
     * 变更后航班标识(新格式)
     */
    private String HBID;

    /**
     * 变更后航班号
     */
    private String NFLN;

    /**
     * 变更后航空公司二字码
     */
    private String NAWC;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SpecialMessages other = (SpecialMessages) that;
        return (this.getSPEC_ID() == null ? other.getSPEC_ID() == null : this.getSPEC_ID().equals(other.getSPEC_ID()))
                && (this.getMETA_ID() == null ? other.getMETA_ID() == null : this.getMETA_ID().equals(other.getMETA_ID()))
                && (this.getFLIGHT_ID() == null ? other.getFLIGHT_ID() == null : this.getFLIGHT_ID().equals(other.getFLIGHT_ID()))
                && (this.getHBID() == null ? other.getHBID() == null : this.getHBID().equals(other.getHBID()))
                && (this.getNFLN() == null ? other.getNFLN() == null : this.getNFLN().equals(other.getNFLN()))
                && (this.getNAWC() == null ? other.getNAWC() == null : this.getNAWC().equals(other.getNAWC()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSPEC_ID() == null) ? 0 : getSPEC_ID().hashCode());
        result = prime * result + ((getMETA_ID() == null) ? 0 : getMETA_ID().hashCode());
        result = prime * result + ((getFLIGHT_ID() == null) ? 0 : getFLIGHT_ID().hashCode());
        result = prime * result + ((getHBID() == null) ? 0 : getHBID().hashCode());
        result = prime * result + ((getNFLN() == null) ? 0 : getNFLN().hashCode());
        result = prime * result + ((getNAWC() == null) ? 0 : getNAWC().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", SPEC_ID=").append(SPEC_ID);
        sb.append(", META_ID=").append(META_ID);
        sb.append(", FLIGHT_ID=").append(FLIGHT_ID);
        sb.append(", HBID=").append(HBID);
        sb.append(", NFLN=").append(NFLN);
        sb.append(", NAWC=").append(NAWC);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}